<?php

namespace app\admin\service\statistics\datatable\phone;

use app\admin\service\statistics\datatable\AbstractQueryStatistician;
use app\admin\service\statistics\traits\CompletionTrait;
use app\admin\service\statistics\traits\FilterTrait;
use app\admin\service\statistics\traits\GrouperCreatedToDateTrait;
use app\common\model\AccessLog;


/**
 * 进入极速咨询UV
 * Class PhoneUvCount
 * @package app\admin\service\statistics\datatable\phone
 */
class PhoneUvCount extends AbstractQueryStatistician
{
    // 筛选器
    use FilterTrait;

    // 分组器
    use GrouperCreatedToDateTrait;

    // 补齐
    use CompletionTrait;

    protected function getQuery()
    {
        return AccessLog::field(['count(DISTINCT ip)' => 'value'])
            ->where('pagePath', AccessLog::PAGE_MEMBER_CONSULTING_PHONE);
    }

    protected function getDefaultValue()
    {
        return '0';
    }
}